package com.zhisuo.apicenter.model;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class ZhiSuoUserRowMapper implements RowMapper<ZhiSuoUser> {

    @Override
    public ZhiSuoUser mapRow(ResultSet rs, int rowNum) throws SQLException {
        ZhiSuoUser user = new ZhiSuoUser();
        user.setId(rs.getInt("id"));
        user.setAvatarurl(rs.getString("avatarurl"));
        user.setMobile(rs.getString("mobile"));
        user.setRealname(rs.getString("realname"));
        user.setNickname(rs.getString("nickname"));
        user.setGender(rs.getInt("gender"));
        user.setSign(rs.getString("sign"));
        user.setSource(rs.getString("source"));
        user.setImage_path(rs.getString("image_path"));
        user.setCreate_time(rs.getTimestamp("create_time"));
        user.setStatus(rs.getInt("status"));
        user.setOpenid(rs.getString("openid"));
        user.setRole(rs.getInt("role"));
      user.setSalemansid(rs.getInt("salemansid"));
        user.setBirthday(rs.getString("birthday"));
        user.setCity(rs.getString("city"));
        user.setCountry(rs.getString("country"));
        user.setProvince(rs.getString("province"));
        user.setIntegral(rs.getInt("integral"));
        return user;
    }

}
